{extend name="web/public/base" /}
{block name="header"}
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a><i class="fa fa-home"></i> 首页</a></li>
        <li class="active">会员管理</li>
        <li class="active">{$title}</li>
    </ul>

    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading font-bold">基本信息</header>
                <div class="panel-body">
                    <a class="btn btn-primary" href="{:url('updateInfo',array('uid'=>$uinfo['uid']))}">修改资料</a>
                </div>
                <div class="panel-body">
                    <div class="row col-lg-12">
                        <div class="form-group col-sm-3">
                            <label>会员账号 :</label>
                            <span>{$uinfo.usernumber}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>会员姓名 :</label>
                            <span>{$uinfo.realname}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>注册时间 :</label>
                            <span>{$uinfo.active_time|date="Y-m-d H:i:s",###}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label> 邮箱:</label>
                            <span>{$uinfo.email|default="无"}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>手机号 :</label>
                            <span>{$uinfo.mobile}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>身份证号 :</label>
                            <span>{$uinfo.IDcard}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>开户银行 :</label>
                            <span>{$uinfo.bankname|default="无"}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>银行卡号 :</label>
                            <span>{$uinfo.banknumber|default="无"}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>开户行 :</label>
                            <span>{$uinfo.bank_address|default="无"}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>支付宝账号 :</label>
                            <span>{$uinfo.alipay|default="无"}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>微信账号:</label>
                            <span>{$uinfo.wechat|default="无"}</span>
                        </div>
                        <!--                        <div class="form-group col-sm-3">-->
                        <!--                            <label>密码 :</label>-->
                        <!--                            <span>{$uinfo.psd1}/{$uinfo.psd2}</span>-->
                        <!--                        </div>-->
                        <div class="form-group col-sm-3">
                            <label>推荐人 :</label>
                            <span>{$uinfo.tuijiannumber|default="公司"}</span>
                        </div>

                        <div class="form-group col-sm-3">
                            <label>会员身份 :</label>
                            <span>{$uinfo.userrank|get_userrank}</span>
                            <select id="userrank">
                                <option value="0" {if condition="$uinfo['userrank'] eq 0" }selected="selected" {/if}>游客</option>
                                <option value="1" {if condition="$uinfo['userrank'] eq 1" }selected="selected" {/if}>会员</option>
                                <option value="2" {if condition="$uinfo['userrank'] eq 2" }selected="selected" {/if}>VIP</option>
                            </select>
                        </div>

                        <div class="form-group col-sm-3">
                            <label>会员职务 :</label>
                            <span>{$uinfo.level|get_level}</span>
                            <!--<select id="level">-->
                                <!--<option value="0" {if condition="$uinfo['level'] eq 0" }selected="selected" {/if}>普通</option>-->
                                <!--<option value="1" {if condition="$uinfo['level'] eq 1" }selected="selected" {/if}>会员</option>-->
                                <!--<option value="2" {if condition="$uinfo['level'] eq 2" }selected="selected" {/if}>代理商</option>-->
                            <!--</select>-->
                        </div>

                        <!--<div class="form-group col-sm-3">-->
                            <!--<label>团队业绩 :</label>-->
                            <!--<span>{$uinfo.achievement}</span>-->
                        <!--</div>-->
                        <div class="form-group col-sm-3">
                            <label>C区业绩 :</label>
                            <span>{$uinfo.achievement}</span>
                        </div>

                    </div>
                </div>
            </section>

            <section class="panel panel-default">
                <header class="panel-heading font-bold">财务信息</header>

                <div class="panel-body">
                    <div class="row col-lg-12">
                        <div class="form-group col-sm-3">
                            <label>{$Think.const.HASBILL} :</label>
                            <span>{$uinfo.finance.hasbill}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>{$Think.const.HASMONEY} :</label>
                            <span>{$uinfo.finance.hasmoney}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>{$Think.const.HASCP} :</label>
                            <span>{$uinfo.finance.hascp}</span>
                        </div>
                        <div class="form-group col-sm-3">
                            <label>{$Think.const.HASGREEN} :</label>
                            <span>{$uinfo.finance.hasgreen}</span>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</section>
{/block}
{block name="footer"}
<script type="text/javascript">
//    function auditing() {
//        layer.confirm('审核结果？', {
//            closeBtn: false,
//            btn: ['同意', '拒绝', '取消'] //可以无限个按钮
//        }, function (index, layero) {
//            //按钮【按钮一】的回调
//            getRet(1);
//        }, function (index) {
//            //按钮【按钮二】的回调
//            getRet(2);
//        }, function (index) {
//            layer.close(index);
//        });
//    }

//    function getRet(type) {
//        // console.log(type);
//        var uid = "{$uinfo.uid}";
//        $.post("{:url('authAudit')}", {uid: uid, type: type}, function (data) {
//            layer.msg(data.msg);
//            if (data.code) {
//                setTimeout(function () {
//                    location.reload();
//                }, 1000)
//            }
//            return false;
//        }, 'json');
//    }

$('#userrank').change(function () {
    var uid = "{$uinfo.uid}";
    var oldrank = "{$uinfo.userrank}";
    var userrank = $(this).val();
    if (oldrank != userrank) {
        $.post("{:url('changeRank')}", {uid: uid, userrank: userrank}, function (data) {
            layer.msg(data.msg);
            if (data.code) {
                setTimeout(function () {
                    location.reload();
                }, 1000)
            }
            return false;
        }, 'json');
    }
})

$('#level').change(function () {
    var uid = "{$uinfo.uid}";
    var level = "{$uinfo.level}";
    var nlevel = $(this).val();
    if (level != nlevel) {
        $.post("{:url('changeLevel')}", {uid: uid, level: nlevel}, function (data) {
            layer.msg(data.msg);
            if (data.code) {
                setTimeout(function () {
                    location.reload();
                }, 1000)
            }
            return false;
        }, 'json');
    }
})
</script>
{/block}
